package vivek.project.pocketmoney.admin.scripts
{
	import flash.data.*;
	import flash.errors.*;
	import vivek.project.pocketmoney.admin.model.AdminDataCache;

	public class AdminSQLScript
	{
		public static const ADD_NEW_ACCOUNT:String="INSERT INTO accountmanager " + "(am_accountname,am_description,am_currencyid,am_minimum,am_color,am_accounttype,am_userid)" + "VALUES (:am_accountName,:am_description,:am_currencyid,:am_minBalance,:am_color,:am_accountType," + ":USERID" + ")";
		public static const ADD_NEW_CHANNEL:String="INSERT INTO CHENNELMANAGER " + "(cm_channelname,cm_channeldesc,cm_userid)" + "VALUES (:cm_channelname,:cm_channeldesc,:USERID)";
		public static const ADD_NEW_CURRENCY:String="INSERT INTO currencymanager " + "(cu_name,cu_rate,cu_symbol)" + "VALUES (:cu_currencyName,:cu_exRate,:cu_symbol)";
		public static const ADD_NEW_USER:String="INSERT INTO USERMANAGER (Um_USERNAME,UM_STATUS,UM_PASSWORD) VALUES (:UM_USERNAME,0,0)";
		public static const DELETE_ACCOUNT:String="delete from accountmanager where  am_accountid= :am_accountid and :am_accountid not in ( select distinct em_accountid from expensemanager)";
		public static const DELETE_CURRENCY:String="delete from currencymanager where cu_id = :cu_id ";
		public static const EXPENSE_GET_DATA_ALL:String="SELECT * FROM expensemanager where em_userid = " + ":USERID" + " ORDER BY ET_DATE";
		public static const SELECT_ACCOUNT_ALL:String="SELECT  *  from accountmanager,accounttype,currencymanager where am_accounttype = accounttype.at_id and  cu_id =  am_currencyid  "
		public static const SELECT_ACCOUNT_ALL_USER:String="SELECT  *  from accountmanager,accounttype,currencymanager where  AM_USERID=" + ":USERID" + " and am_accounttype = accounttype.at_id and  cu_id =  am_currencyid  "
		public static const SELECT_ACCOUNT_DATA:String="SELECT * FROM ACCOUNTMANAGER,currencymanager where cu_id = am_currencyid and AM_USERID=" + ":USERID";
		public static const SELECT_ACCOUNT_TYPE_ALL:String="select *  from accounttype";
		public static const SELECT_CATEGORY_ALL:String="select * from categorymanager";
		public static const SELECT_CHANNEL_ALL:String="SELECT  *  from CHENNELMANAGER";
		public static const SELECT_CURRENCY_ALL_DETAILS:String="SELECT * FROM CURRENCYMANAGER";
		public static const SELECT_USER_ALL:String="SELECT  *  from USERMANAGER";
		public static const SET_USER_DEFAULT:String="update usermanager set um_status=1 where um_userid= :UM_USERID";
		public static const SET_USER_NODEFAULT:String="update usermanager set um_status=0 where um_userid!= :UM_USERID";
		public static const UPDATE_ACCOUNT:String="UPDATE accountmanager SET " + " am_accountName = :am_accountName,am_description = :am_description, am_accounttype = :am_accounttype , " + "am_currencyid = :am_currencyid, am_color = :am_color, am_minimum = :am_minimum " + "where am_accountid = :am_accountid";
		public static const UPDATE_CURRENCY:String="UPDATE currencymanager SET" + " cu_name = :cu_currencyName ,cu_rate = :cu_exRate,cu_symbol = :cu_symbol" + " where cu_id = :cu_id";
		//	+ " :cu_id not in ( select distinct em_accountid from expensemanager) " ;
	}
}